<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>浏览器知识点 | 学习笔记</title><meta name="author" content="lzoxun"><meta name="copyright" content="lzoxun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="浏览器输入url后 一、从浏览器接收 url 到开启网络请求线程  这一部分可以展开浏览器的机制以及进程与线程之间的关系  浏览器是多进程的，有一个主控进程，以及每一个 tab 页面都会新开一个进程 tab 页面都可以看作是浏览器的内核进程 ( 包括 GUI 线程、JS 引擎线程、事件触发线程、定时器线程、网络请求线程等多个线程 ) 解析 URL ( 协议&#x2F;&#x2F;主机:端口号&amp;#x">
<meta property="og:type" content="article">
<meta property="og:title" content="浏览器知识点">
<meta property="og:url" content="http://example.com/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/script-model-browser/index.html">
<meta property="og:site_name" content="学习笔记">
<meta property="og:description" content="浏览器输入url后 一、从浏览器接收 url 到开启网络请求线程  这一部分可以展开浏览器的机制以及进程与线程之间的关系  浏览器是多进程的，有一个主控进程，以及每一个 tab 页面都会新开一个进程 tab 页面都可以看作是浏览器的内核进程 ( 包括 GUI 线程、JS 引擎线程、事件触发线程、定时器线程、网络请求线程等多个线程 ) 解析 URL ( 协议&#x2F;&#x2F;主机:端口号&amp;#x">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2023-07-22T07:14:09.690Z">
<meta property="article:modified_time" content="2023-07-22T07:14:09.690Z">
<meta property="article:author" content="lzoxun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/script-model-browser/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '浏览器知识点',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-22 15:14:09'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="学习笔记"><span class="site-name">学习笔记</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">浏览器知识点</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-07-22T07:14:09.690Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-22T07:14:09.690Z" title="更新于 2023-07-22 15:14:09">2023-07-22</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="浏览器知识点"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="浏览器输入url后"><a href="#浏览器输入url后" class="headerlink" title="浏览器输入url后"></a>浏览器输入url后</h2><blockquote>
<p>一、从浏览器接收 url 到开启网络请求线程</p>
</blockquote>
<p>这一部分可以展开浏览器的机制以及进程与线程之间的关系</p>
<ul>
<li>浏览器是<strong>多进程</strong>的，有一个主控进程，以及<strong>每一个 tab 页面</strong>都会新开一个进程</li>
<li><strong>tab 页面</strong>都可以看作是浏览器的内核进程 ( 包括 <strong>GUI 线程</strong>、<strong>JS 引擎线程</strong>、<strong>事件触发线程</strong>、<strong>定时器线程</strong>、<strong>网络请求线程</strong>等多个线程 )</li>
<li>解析 URL ( 协议&#x2F;&#x2F;主机:端口号&#x2F;目录路径?查询参数#hash)</li>
<li>解析协议 : 浏览器会根据解析出的<strong>协议</strong>，开辟一个<strong>网络线程</strong>，<strong>前往</strong>请求资源</li>
</ul>
<blockquote>
<p>二、开启网络线程到发出一个完整的 http 请求</p>
</blockquote>
<p>这一部分涉及到 dns 查询，tcp&#x2F;ip 请求，五层因特网协议栈等知识</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1、解析主机 : 如果输入主机的是域名，需要进行 dns 解析成 IP</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1-1、如果浏览器有缓存，直接使用浏览器缓存，否则使用本机缓存，再没有的话就是用host</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1-2、如果本地没有，就向dns域名服务器查询，查询到对应的IP</span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">2、连接主机 : tcp/ip 请求(三次握手建立连接发送请求,四次挥手断开连接)</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">2-1、3次过程</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">	2-1-1、</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">	2-1-2、</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">	2-1-3、</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">2-2、4次过程</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">	2-2-1、</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">	2-2-2、</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">	2-2-3、</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash">	2-2-4、</span></span><br></pre></td></tr></table></figure>



<blockquote>
<p>三、从服务器接收到请求后的处理</p>
</blockquote>
<p>这一部分可能涉及到<strong>负载均衡</strong>，<strong>安全拦截</strong>以及<strong>后台内部的处理</strong>等等</p>
<p>1、<strong>负载均衡：</strong>对于大型的项目，由于并发访问量很大，所以往往一台服务器是吃不消的，所需要的处理方案称为负载均衡<br>2、<strong>步骤</strong><br>    2-1、一般有的后端是有统一的验证的，如安全拦截，跨域验证<br>    2-2、如果这一步不符合规则，就直接返回了相应的http报文（如拒绝请求等）<br>    2-3、然后当验证通过后，才会进入实际的后台代码，此时是程序接收到请求，然后执行（譬如查询数据库，大量计算等等）<br>    2-4、等程序执行完毕后，就会返回一个http响应包（一般这一步也会经过多层封装）<br>    2-5、然后就是将这个包从后端发送到前端，完成交互 </p>
<blockquote>
<p>四、后台和前台的 http 交互</p>
</blockquote>
<p>这一部分包括 <strong>http 响应头</strong>、<strong>响应码</strong>、<strong>报文结构</strong>、<strong>cookie</strong>、<strong>token</strong> 等，编码解码，如 gzip 压缩等</p>
<p>1、 http 报文(http 报文作为信息的载体)<br>响应报文报文分为<strong>响应行、响应头、和响应体</strong>;请求报文分为<strong>请求行、请求头、和请求体</strong> ，get 请求无请求体</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1-1、通用头部(General)</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    1-1-1、Request Url:      <span class="comment"># 请求的web服务器地址</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    1-1-1、Request Method:   <span class="comment"># 请求方式（http:1.1 -&gt; Get、POST、OPTIONS、PUT、HEAD、DELETE、CONNECT、TRACEd等）</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    1-1-1、Status Code:      <span class="comment"># 请求的返回状态码，如200代表成功</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        1xx——指示信息，表示请求已接收，继续处理</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        2xx——成功，表示请求已被成功接收、理解、接受</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        3xx——重定向，要完成请求必须进行更进一步的操作</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        4xx——客户端错误，请求有语法错误或请求无法实现</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        5xx——服务器端错误，服务器未能实现合法的请求</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#         200——表明该请求被成功地完成，所请求的资源发送回客户端</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        304——自从上次请求后，请求的网页未修改过，请客户端使用本地缓存</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        400——客户端请求有错（譬如可以是安全模块拦截）</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        401——请求未经授权</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        403——禁止访问（譬如可以是未登录时禁止）</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        404——资源未找到</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        500——服务器内部错误</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        503——服务不可用</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        .....</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#     1-1-1、Remote Address: 请求的远程服务器地址</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment"># 1-2、请求头(Request headers) [view source 请求行: POST /url HTTP/1.1]</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Accept:      <span class="comment"># 接收类型，表示浏览器支持的MIME类型（对标服务端返回的Content-Type）</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Accept-Encoding：     <span class="comment"># 浏览器支持的压缩类型,如gzip等,超出类型不能接收</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Content-Type：     <span class="comment"># 客户端发送出去请求体内容的类型</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;application/x-www-form-urlencoded&#x27;</span>: <span class="string">&#x27;URLSearchParams:name=username&amp;age=20&#x27;</span> 表单格式</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;application/json&#x27;</span>: <span class="string">&quot;&#123;name:&#x27;username&#x27;,age:20&#125;&quot;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;multipart/form-data&#x27;</span>: <span class="string">&quot;FormData 对象&quot;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;Blob/BufferSource&#x27;</span>: <span class="string">&quot;二进制数据&quot;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#              # 服务器返回</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;text/plain;charset=UTF-8&#x27;</span>:<span class="string">&#x27;普通文本&#x27;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">        <span class="string">&#x27;text/html;charset=UTF-8&#x27;</span>:<span class="string">&#x27;html标签&#x27;</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">             <span class="comment"># 对照表 https:     # tool.oschina.net/commons)</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"> </span>       </span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Cache-Control:      <span class="comment"># 指定请求和响应遵循的缓存机制，如no-cache</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    If-Modified-Since：     <span class="comment"># 对应服务端的Last-Modified，用来匹配看文件是否变动，只能精确到1s之内，http1.0中</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Expires：     <span class="comment"># 缓存控制，在这个时间内不会请求，直接使用缓存，http1.0，而且是服务端时间</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Max-age：     <span class="comment"># 代表资源在本地缓存多少秒，有效时间内不会请求，而是使用缓存，http1.1中</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    If-None-Match：     <span class="comment"># 对应服务端的ETag，用来匹配文件内容是否改变（非常精确），http1.1中</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Cookie:      <span class="comment"># 有cookie并且同域访问时会自动带上</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Connection:      <span class="comment"># 当浏览器与服务器通信时对于长连接如何进行处理,如keep-alive</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Host：     <span class="comment"># 请求的服务器URL</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Origin：     <span class="comment"># 最初的请求是从哪里发起的（只会精确到端口）,Origin比Referer更尊重隐私</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Referer：     <span class="comment"># 该页面的来源URL(适用于所有类型的请求，会精确到详细页面地址，csrf拦截常用到这个字段)</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    User-Agent：     <span class="comment"># 用户客户端的一些必要信息，如UA头部等</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1-3、响应头(Response headers) [view <span class="built_in">source</span> 响应行:HTTP/1.1 200]</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Access-Control-Allow-Headers:      <span class="comment"># 服务器端允许的请求Headers</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Access-Control-Allow-Methods:      <span class="comment"># 服务器端允许的请求方法</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Access-Control-Allow-Origin:      <span class="comment"># 服务器端允许的请求Origin头部（譬如为*）</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Content-Type：     <span class="comment"># 服务端返回的响应体内容的类型</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Date：     <span class="comment"># 数据从服务器发送的时间</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Cache-Control：     <span class="comment"># 告诉浏览器或其他客户，什么环境可以安全的缓存文档</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Last-Modified：     <span class="comment"># 请求资源的最后修改时间</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Expires：     <span class="comment"># 应该在什么时候认为文档已经过期,从而不再缓存它</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Max-age：     <span class="comment"># 客户端的本地资源应该缓存多少秒，开启了Cache-Control后有效</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    ETag：     <span class="comment"># 请求变量的实体标签的当前值</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Set-Cookie：     <span class="comment"># 设置和页面关联的cookie，服务器通过这个头部把cookie传给客户端</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Keep-Alive：     <span class="comment"># 如果客户端有keep-alive，服务端也会有响应（如timeout=38）</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">    Server：     <span class="comment"># 服务器的一些相关信息</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"></span></span><br><span class="line"><span class="language-bash"><span class="comment">#      # 譬如，请求头部的Accept要和响应头部的Content-Type匹配，否则会报错</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">     <span class="comment"># 譬如，跨域请求时，请求头部的Origin要匹配响应头部的Access-Control-Allow-Origin，否则会报跨域错误。。。</span></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">1-4、请求/响应体</span></span><br><span class="line">...</span><br></pre></td></tr></table></figure>

<p>2、 长连接与短连接</p>
<p><strong>长连接：</strong>一个tcp&#x2F;ip连接上可以连续发送多个数据包，在tcp连接保持期间，如果没有数据包发送，需要双方发检测包以维持此连接，一般需要自己做在线维持（类似于心跳包）http1.1起，默认使用长连接，使用长连接会有这一行Connection: keep-alive<br><strong>短连接：</strong>通信双方有数据交互时，就建立一个tcp连接，数据发送完成后，则断开此tcp连接(http1.0默认短连接)</p>
<blockquote>
<p>https</p>
</blockquote>
<ul>
<li>https 就是安全版本的 http，譬如一些支付等操作基本都是基于 https 的，因为 http 请求的安全系数太低了。</li>
<li>简单来看，https 与 http 的区别就是： 在请求前，<strong>会建立 ssl 链接，确保接下来的通信都是加密的</strong>，无法被轻易截取分析</li>
<li>一般来说，如果要将网站升级成 https，需要后端支持（后端需要申请证书等），然后 https 的开销也比 http 要大（因为需要额外建立安全链接以及加密等），所以*一般来说 http2.0 配合 https 的体验更佳（因为 http2.0 更快了）</li>
</ul>
<blockquote>
<p>http 2.0</p>
</blockquote>
<p>6-1、http2.0不是https，它相当于是http的下一代规范<br>6-2、然后简述下http2.0与http1.1的显著不同点：<br>http1.1中，每请求一个资源，都是需要开启一个tcp&#x2F;ip连接的，所以对应的结果是，每一个资源对应一个tcp&#x2F;ip请求，由于tcp&#x2F;ip本身有并发数限制，所以当资源一多，速度就显著慢下来<br>http2.0中，一个tcp&#x2F;ip请求可以请求多个资源，也就是说，只要一次tcp&#x2F;ip请求，就可以请求若干个资源，分割成更小的帧请求，速度明显提升。<br>所以，如果http2.0全面应用，很多http1.1中的优化方案就无需用到了（譬如打包成精灵图，静态资源多域名拆分等）<br>6-3、然后简述下http2.0的一些特性：<br>多路复用（即一个tcp&#x2F;ip连接可以请求多个资源）<br>首部压缩（http头部压缩，减少体积）<br>二进制分帧（在应用层跟传送层之间增加了一个二进制分帧层，改进传输性能，实现低延迟和高吞吐量）<br>服务器端推送（服务端可以对客户端的一个请求发出多个响应，可以主动通知客户端）<br>请求优先级（如果流被赋予了优先级，它就会基于这个优先级来处理，由服务器决定需要多少资源来处理该请求。）</p>
<hr>
<blockquote>
<p>五、缓存</p>
</blockquote>
<p>5-1、强缓存(200 from cache)与弱缓存(304)</p>
<ul>
<li>强缓存（200 from cache）时，浏览器如果判断本地缓存未过期，就直接使用，无需发起 http 请求</li>
<li>协商缓存（304）时，浏览器会向服务端发起 http 请求，然后服务端告诉浏览器文件未改变，让浏览器使用本地缓存</li>
<li>对于协商缓存，使用 Ctrl + F5 强制刷新可以使得缓存无效</li>
<li>但是对于强缓存，在未过期时，必须更新资源路径才能发起新的请求（更改了路径相当于是另一个资源了，这也是前端工程化中常用到的技巧）</li>
</ul>
<p>5-2、相关头部</p>
<blockquote>
<p>If-None-Match&#x2F;E-tag、If-Modified-Since&#x2F;Last-Modified、Cache-Control&#x2F;Max-Age、Pragma&#x2F;Expires</p>
</blockquote>
<p>http1.0 中的缓存控制：</p>
<ul>
<li>Pragma</li>
<li>Expires 用的是服务器时间</li>
<li>请求头(浏览器端)If-Modified-Since 与 响应头(服务器端) Last-Modifie 相匹配,说明内容未变(协商缓存)</li>
</ul>
<p>http1.1 中的缓存控制：</p>
<ul>
<li>Cache-Control：缓存控制头部，有 no-cache、max-age 等多种取值</li>
<li>max-age&#x3D;’xxx’：服务端配置的，用来控制强缓存，在规定的时间之内，浏览器无需发出请求，直接使用本地缓存</li>
<li>请求头(浏览器端)If-None-Match 与 响应头(服务器端) E-tag 相匹配,说明内容未变(协商缓存)</li>
</ul>
<p>E-tag 相比 Last-Modified？</p>
<pre><code>Last-Modified：
表明服务端的文件最后何时改变的
它有一个缺陷就是只能精确到1s，
然后还有一个问题就是有的服务端的文件会周期性的改变，导致缓存失效

E-tag：
是一种指纹机制，代表文件相关指纹
只有文件变才会变，也只要文件变就会变，
也没有精确时间的限制，只要文件一遍，立马E-tag就不一样了

如果同时带有E-tag和Last-Modified，服务端会优先检查E-tag
</code></pre>
<blockquote>
<p>六、 浏览器接收到 http 数据包后的解析流程</p>
</blockquote>
<p><img src= "" data-lazy-src="/../../../../static/img/2022-12-06_225757.jpg"></p>
<p>1、 解析 <code>HTML</code>，构建 <code>DOM</code> 树<br>         生产DOM树之前如果与到js代码会先执行js，再继续渲染，否则如果js有操作dom的话会渲染频繁</p>
<p>2、 解析 <code>CSS</code>，生成 <code>CSSOM</code> 树</p>
<p>3、 合并 <code>DOM</code> 树和 <code>CSSOM</code> 树，生成 <code>render</code> 树</p>
<p>4、 布局 <code>render</code> 树（<code>Layout/reflow</code>），负责各元素尺寸、位置的计算</p>
<ul>
<li><code>Layout</code> 也称为 <code>Reflow</code>，即<strong>回流</strong>,一般意味着元素的内容、结构、位置或尺寸发生了变化，需要重新计算样式和渲染树</li>
<li><code>Repaint</code> 也称为即<strong>重绘</strong>。意味着元素发生的改变只是影响了元素的一些外观之类的时候（例如，背景色，边框颜色，文字颜色等），此时只需要应用新样式绘制这个元素就可以了</li>
</ul>
<p>回流的成本开销要高于重绘，而且一个节点的回流往往回导致子节点以及同级节点的回流，<br>所以优化方案中一般都包括，尽量避免回流。</p>
<p>引起回流重绘的条件</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 1.页面渲染初始化</span></span><br><span class="line"><span class="comment"> * 2.DOM结构改变，比如删除了某个节点</span></span><br><span class="line"><span class="comment"> * 3.render树变化，比如减少了padding</span></span><br><span class="line"><span class="comment"> * 4.窗口resize</span></span><br><span class="line"><span class="comment"> * 5.最复杂的一种：获取某些属性，引发回流,DOM操作</span></span><br><span class="line"><span class="comment"> *		很多浏览器会对回流做优化，会等到数量足够时做一次批处理回流</span></span><br><span class="line"><span class="comment"> *      但是除了render树的直接变化，当获取一些属性时，浏览器为了获得正确的值也会触发回流，这样使得浏览器优化无效，包括</span></span><br><span class="line"><span class="comment"> *         （1）offset(Top/Left/Width/Height)</span></span><br><span class="line"><span class="comment"> *          (2) scroll(Top/Left/Width/Height)</span></span><br><span class="line"><span class="comment"> *          (3) cilent(Top/Left/Width/Height)</span></span><br><span class="line"><span class="comment"> *          (4) width,height</span></span><br><span class="line"><span class="comment"> *          (5) 调用了getComputedStyle()或者IE的currentStyle</span></span><br><span class="line"><span class="comment"> * 6、改变字体大小会引发回流</span></span><br><span class="line"><span class="comment"> *    一般dom结构发生变化引发回流加重绘,样色变化只会发生重绘, 回流一定伴随着重绘，重绘却可以单独出现</span></span><br><span class="line"><span class="comment"> *</span></span><br><span class="line"><span class="comment"> */</span></span><br></pre></td></tr></table></figure>

<p>5、绘制（paint)，将可将元素绘制到屏幕中</p>
<p>​      默认标准流是在<strong>同一层绘制</strong>，一些特殊属性(<strong>如定位</strong>) <strong>会创建新的层</strong>绘制，被称为**渲染层 **</p>
<p>​      不影响布局的<strong>CSS修改</strong>也会导致<strong>渲染层重绘（Repaint）</strong>，<strong>回流必然导致重绘</strong></p>
<p>6、<strong>Composite 合成层</strong></p>
<p>​      一些特殊属性（<code>transform 3d</code>属性）会创建一个新的合成层，并可以利用<strong>GPU来加速绘制</strong>，这时浏览器的优化手段</p>
<p>​      合成层以<strong>消耗内存</strong>为代价提高<strong>页面性能</strong>，动画更加顺畅，<strong>过度使用GPU不够电脑会卡</strong></p>
<blockquote>
<p>七、 CSS 的可视化格式模型</p>
</blockquote>
<p>元素的渲染规则，如包含块，控制框，BFC，IFC 等概念</p>
<blockquote>
<p>八、 JS 引擎</p>
</blockquote>
<p><strong>作用：</strong>将js转汇编转二进制最终变为cpu可以认识的数据<br>JS 的解释阶段，预处理阶段，执行阶段生成执行上下文，VO，作用域链、回收机制等等</p>
<ul>
<li>常见的JS引擎<ul>
<li><code>SpiderMonkey</code>:第一款，也是作者<code>Brendan Eich</code>开发的</li>
<li><code>Chakra</code>:微软开发主要<code>IE</code>浏览器</li>
<li><code>JavaScriptCore</code>:浏览器引擎(WebKit)中的内置JS引擎，Apply公司开发(小程序的JsCore)<ul>
<li>WebKit &#x3D; 渲染工作的(WebCore) 与 JS引擎(JavaScriptCore) 组成</li>
</ul>
</li>
<li><code>V8</code>:Google开发<ul>
<li><code>在Chrome中，只有Html的渲染采用了WebKit的WebCore代码，而在JavaScript上，重新搭建了一个NB哄哄的V8引</code></li>
<li><code>谷歌浏览器体验好的原因之一</code></li>
<li><code>V8</code><ul>
<li>C++编写，作为js引擎的话主要用于Google浏览器与NodeJs</li>
<li>也有作为其他语言的引擎，如<code>WebAssembly</code></li>
<li>可以独立运行，也能嵌入C++应用程序中 </li>
<li>工作过程：<ul>
<li>js引擎中的<code>Parse模块</code>，将js中有用到的代码转换成<code>AST（抽象语法树）</code>，引擎中的<code>Ignition(解释器)</code>才能认识解析</li>
<li><code>Ignition(解释器)</code>将<code>AST</code>转成<code>ByteCode(字节码)</code>，同时收集<code>TurboFan</code>优化需要的信息</li>
<li><code>TurboFan(编译器)</code>可以将字节码编译成CPU可以直接执行的机器码<ul>
<li>如果函数被多次调用，会被标记为热点函数，<code>直接</code>通过<code>TurboFan</code>转为机器码</li>
<li>但是函数后续执行时，如类型发生变化等等，机器码不能正确处理运算，就会被逆向还原为<code>字节码</code>（所以类型不固定很耗性能）</li>
</ul>
</li>
<li><code>Orinoco</code> V8内存回收模块</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<blockquote>
<p>九、所有浏览器 userAgent 都是 Mozilla?</p>
</blockquote>
<blockquote>
<p>最初浏览器 NCSA Mosaic，简称 Mosaic,<br>后面出现另外一款浏览器 Mozilla( Mosaic + Killer)，–&gt; Mozilla 更名为 Netscape，也就是网景<br><code>网站管理员探测 user agent，对 Mozilla 浏览器发送含有框架的页面，对非 Mozilla 浏览器发送没有框架的页面。</code><br>后面软开发了自己的浏览器，Internet Explorer –&gt; (开始只有 Mozilla 支持框架（frame），为了快速收到含有框架的页面了)微软宣布 IE 是兼容 Mozilla，并且模仿 Netscape 称 IE 为“Mozilla&#x2F;1.22“<br>后面微软与网景的浏览器大众，网景失败退出<br>Netscape 居然以 Mozilla(后面更名 Firefox)的名义重生了，并且开发了 <code>Gecko渲染引擎</code>（Mozilla&#x2F;5.0(Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko&#x2F;20020826）<br>Mozilla 后来变成了 Firefox，并自称“Mozilla&#x2F;5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.7.5) Gecko&#x2F;20041108 Firefox&#x2F;1.0”<br>很多浏览器使用了它的代码，每一个都将自己装作 Mozilla，而它们全都使用 Gecko。<br><code>Gecko 很出色,因此 user agent 探测规则变了，使用 Gecko 的浏览器被发送了更好的代码</code><br>linux Konqueror 浏览器<code>KHTML渲染引擎</code> 伪装 Gecko <code>like Gecko</code>(Mozilla&#x2F;5.0 (compatible; Konqueror&#x2F;3.2; FreeBSD) (KHTML, like Gecko))<br>Opera<br>后来苹果开发了 Safari 浏览器，并使用 KHTML 作为渲染引擎<br>但苹果加入了许多新的特性，于是苹果从 KHTML 另辟分支称之为 <code>WebKit</code><br>但它又不想抛弃那些为 KHTML 编写的页面，于是 Safari 自称为“Mozilla&#x2F;5.0 (Macintosh; U; PPC Mac OS X; de-de) AppleWebKit&#x2F;85.7 (KHTML, like Gecko) Safari&#x2F;85.5”<br>再后来，谷歌开发了 Chrome 浏览器，Chrome 使用 Webkit 作为渲染引擎(后面渲染引擎改用 Blink(基于 Webkit 开发)，V8 是 js 引擎不是渲染引擎)<br>和 Safari 之前一样，它想要那些为 Safari 编写的页面，于是它伪装成了 Safari<br>于是 Chrome 使用 WebKit，并将自己伪装成 Safari，WebKit 伪装成 KHTML，KHTML 伪装成 Gecko，最后所有的浏览器都伪装成了 Mozilla<br><code>因为网站开发者可能会因为你是某浏览器（这里是 Mozilla），所以输出一些特殊功能的程序代码（这里指好的特殊功能），所以当其它浏览器也支持这种好功能时，就试图去模仿 Mozilla 浏览器让网站输出跟 Mozilla 一样的内容，而不是输出被阉割功能的程序代码。大家都为了让网站输出最好的内容，都试图假装自己是 Mozilla，一个已经不存在的浏览器……</code></p>
</blockquote>
<ul>
<li>渲染引擎之间关系(内核也叫做排版引擎、渲染引擎、浏览器引擎等)<ul>
<li>Gecko(Firefox)</li>
<li>KHTML(linux Konqueror)</li>
<li>KHTML –&gt; Webkit(Safari)</li>
<li>KHTML –&gt; Webkit –&gt; Blink(chrome)</li>
<li>Presto(欧鹏) -&gt; 欧鹏 Presto 后期被 Blink 代替</li>
<li>Trident(IE)</li>
<li>EdgeHTML(Edge 浏览器) –&gt; 后期被 Blink 代替<blockquote>
<p>十、 其它</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<p>可以拓展不同的知识模块，如跨域，web 安全，hybrid 模式等等内容</p>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p><a target="_blank" rel="noopener" href="https://segmentfault.com/a/1190000013662126#articleHeader10">from</a></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://example.com">lzoxun</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/script-model-browser/">http://example.com/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/script-model-browser/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">学习笔记</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/h5-model-webRTC/" title="webRTC 直播功能"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">webRTC 直播功能</div></div></a></div><div class="next-post pull-right"><a href="/2023/07/22/web/JavaScript/%E5%9E%83%E5%9C%BE%E6%A1%B6/script-model-websocket/" title="websocket"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">websocket</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">lzoxun</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/liaozhongxun"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/liaozhongxun" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:869664233@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">这是我的文档</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%B5%8F%E8%A7%88%E5%99%A8%E8%BE%93%E5%85%A5url%E5%90%8E"><span class="toc-number">1.</span> <span class="toc-text">浏览器输入url后</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">2.</span> <span class="toc-text">总结</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-11/" title="win 11 set">win 11 set</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-gitbash/" title="git bash">git bash</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-wsl/" title="wsl">wsl</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-main/" title="window">window</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/web/%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98/" title="兼容问题">兼容问题</a><time datetime="2023-07-22T07:14:09.699Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By lzoxun</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/haruto.model.json"},"display":{"position":"right","width":100,"height":200,"right":300},"mobile":{"show":true}});</script></body></html>